local M = {}

local tCfg = require("components.cfgs")

local bg = require("components.bg")
local item = require("components.item")

local function drawCfg()
	local rowShowNum = 3

	local totalNum = #tCfg
	for index = 1, totalNum do
		local row = math.ceil(index/3)
		local col = (index - 1)%3 + 1

		local g = item.createItem({cfg = tCfg[index]})
		g.x, g.y = 80 + (col - 1)*150, 40 + (row - 1)*40

		gComp:insert(g)
	end
end

function M.new()
	local gRect = bg.new()
	gComp:insert(gRect)

	gComp.x = W - 800
	gComp.y = 40

	drawCfg()
end

return M